#include "AVLTree.h"

void test1()
{
    AVLTree<string, string> a1;
    a1.insert(pair<string, string>("a", "我是a"));
    a1.insert(pair<string, string>("b", "我是b"));
    a1.insert(pair<string, string>("c", "我是c"));
    a1.insert(pair<string, string>("d", "我是d"));
    a1.insert(pair<string, string>("e", "我是e"));
    a1.insert(pair<string, string>("f", "我是f"));

    a1.InOrder();
}

void test2()
{
    vector<int> arr = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
    AVLTree<int, int> a;
    for (auto& e : arr)
    {
        a.insert(make_pair(e, e));
    }
    a.InOrder();
}

void test3()
{
    srand(time(0));
    int N = 1000;
    AVLTree<int, int> a;
    for (int i = 0; i < N; i++)
    {
        int x = rand();
        
        a.insert(make_pair(x, x));
        cout << "IsBalance : " << a.AVLTreeTrue() << endl;
    }
    a.InOrder();
}

int main()
{
    //test1();
    //test2();
    test3();

    return 0;
}

